gsk_ngl_glyph_library_upload_glyph (GskNglGlyphLibrary *self,
const GskNglGlyphKey *key,
const GskNglGlyphValue *value,
+ int x,
+ int y,
int width,
int height,
double device_scale)
{
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
cairo_scaled_font_t *scaled_font;
- GskNglTextureAtlas *atlas;
cairo_surface_t *surface;
guchar *pixel_data;
guchar *free_data = NULL;
guint gl_type;
guint texture_id;
gsize stride;
- int x, y;
g_assert (GSK_IS_NGL_GLYPH_LIBRARY (self));
g_assert (key != NULL);
return;
stride = cairo_format_stride_for_width (CAIRO_FORMAT_ARGB32, width);
- atlas = value->entry.is_atlased ? value->entry.atlas : NULL;
gdk_gl_context_push_debug_group_printf (gdk_gl_context_get_current (),
"Uploading glyph %d",
gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- if G_LIKELY (atlas != NULL)
- {
- x = atlas->width * value->entry.area.x;
- y = atlas->width * value->entry.area.y;
- }
- else
- {
- x = 0;
- y = 0;
- }
-
glTexSubImage2D (GL_TEXTURE_2D, 0, x, y, width, height,
gl_format, gl_type, pixel_data);
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
if (key->yshift != 0)
ink_rect.height++;
- width = ink_rect.width * key->scale / 1024;
- height = ink_rect.height * key->scale / 1024;
+ width = (int) ceil (ink_rect.width * key->scale / 1024.0);
+ height = (int) ceil (ink_rect.height * key->scale / 1024.0);
value = gsk_ngl_texture_library_pack (GSK_NGL_TEXTURE_LIBRARY (self),
key,
gsk_ngl_glyph_library_upload_glyph (self,
key,
value,
+ packed_x + 1,
+ packed_y + 1,
width,
height,
key->scale / 1024.0);